<?php
/*********************************************************************\
* This File is a part of BH-PANEL (Breizh-Heberg Panel v2.1)
* Copyright (C) 2008-2009 the BH Developpers : Vincent Giersch <mail@vincordi.fr>, Cyprien Laleau <fanning.fr@gmail.com> and Edwin Cabiten <marmottes44@hotmail.fr>
* See file AUTHORS to get more informations

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.

* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.

* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
/*********************************************************************/


session_start();
if(isset($_POST['ajax'])) {
	define('IN', '1');
	define('REQUEST_AJAX', '1');
	include('../php/lib/common.php');
	connexionbdd();
	$tpl = new gagatemplate('../');
	$id_entree = intval($_POST['id']);
	$exist = query("SELECT
					comptes_domain.domaine,
					comptes_domain.u_nic,
					comptes_domain.zone_dns,
					zones_dns_content.id,
					zones_dns_content.*
					FROM zones_dns_content
					LEFT JOIN comptes_domain
					ON zones_dns_content.id_zone=comptes_domain.zone_dns
					WHERE zones_dns_content.id = '$id_entree' AND comptes_domain.u_nic='".$_SESSION['u_nic']."'");
	if(mysql_num_rows($exist) == 1) {
		$entree = mysql_fetch_array($exist);
		$tpl->assign(array(
			'type' => $entree['type'],
			'value_mx' => $entree['value_mx'],
			'value' => $entree['value'],
			'id' => $id_entree,
			'current_dom' => $entree['domaine'],
			'entree' => $entree['entree'],
		));
		$tpl->parse('panel-domaine-zdns-entree-mod-req.html');
	}
	elseif($id_entree == 0) {}
	else {
		echo "Une erreur s'est produite.";
	}
	deconnexionbdd();
}
?>